﻿Imports MySoft.Map.Data
Partial Class ProjPlanApprove_ExtendForm
    Inherits System.Web.UI.Page

#Region " Web 窗体设计器生成的代码 "

    '该调用是 Web 窗体设计器所必需的。
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()

    End Sub
    Protected WithEvents txtIsSuperApprove As System.Web.UI.WebControls.TextBox
    Protected WithEvents txtPlanType As System.Web.UI.WebControls.TextBox
    Protected WithEvents ApplyDept As System.Web.UI.WebControls.DropDownList

    '注意: 以下占位符声明是 Web 窗体设计器所必需的。
    '不要删除或移动它。
    Private designerPlaceholderDeclaration As System.Object

    Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
        'CODEGEN: 此方法调用是 Web 窗体设计器所必需的
        '不要使用代码编辑器修改它。
        InitializeComponent()
    End Sub

#End Region

    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        '在此处放置初始化页的用户代码
        CreateDropDownData()

    End Sub


    '生成报告年月下拉框数据
    Private Function CreateDropDownData()
        Dim i As Integer
        Dim dtTmp As New DataTable, drTmp As DataRow


        '生成报告年份下拉框中的数据：以当前年份为准，前 5 年、后 3 年
        dtTmp.Columns.Add("sText", Type.GetType("System.String"))
        dtTmp.Columns.Add("sValue", Type.GetType("System.String"))

        Dim intYear As Integer = Today.Year - 5
        For i = 1 To 8
            drTmp = dtTmp.NewRow
            drTmp.Item("sText") = (intYear + i).ToString.Trim()
            drTmp.Item("sValue") = (intYear + i).ToString.Trim()
            dtTmp.Rows.Add(drTmp)
        Next
        ddl_Year.DataSource = dtTmp
        ddl_Year.DataValueField = "sValue"
        ddl_Year.DataTextField = "sText"
        ddl_Year.DataBind()

        ddl_Year.SelectedValue = Today.Year.ToString.Trim()


        '生成月份数据：1、2、3。。。12
        dtTmp.Clear()
        For i = 1 To 12
            drTmp = dtTmp.NewRow
            drTmp.Item("sText") = i.ToString.PadLeft(2, "0")
            drTmp.Item("sValue") = i.ToString.PadLeft(2, "0")
            dtTmp.Rows.Add(drTmp)
        Next
        ddl_Month.DataSource = dtTmp
        ddl_Month.DataValueField = "sValue"
        ddl_Month.DataTextField = "sText"
        ddl_Month.DataBind()

        ddl_Month.SelectedValue = Today.Month.ToString.PadLeft(2, "0")


    End Function
End Class
